#include <stdio.h>
#include "dclcd.h"
#include "tskcfg.h"
#include "bsp.h"
#include "gui_asclib.h"

static void mute(void);
static void power(void);
static void menu(void);
static void keyret(void);
static void enter(void);
static void down(void);
static void up(void);
static void left(void);
static void right(void);
static void ok(void);
static void volinc(void);
static void voldec(void);
static void keyt(void);

static void load(uint8_t nowpage, uint8_t nowfocus);

static const uint8_t ssid = 0;

const static GUI_FormKeysStru gui_mainmenu_keys = 
{
	.mute =   NULL,
	.power =  NULL,
  .keyt =   keyt,
  .set =    gui_form_common_set,
  .home =   gui_form_common_home,
  .menu =   menu,
  .keyret = NULL,
  .enter =  gui_form_common_enter,
	.down =   NULL,
	.up =     NULL,
	.left =   NULL,
	.right =  NULL,
	.ok =     NULL,
	.volinc = NULL,
	.voldec = NULL,
	.key0 =   NULL,
	.key1 =   NULL,
	.key2 =   NULL,
	.key3 =   NULL,
	.key4 =   NULL,
	.key5 =   NULL,
	.key6 =   NULL,
	.key7 =   NULL,
	.key8 =   NULL,
	.key9 =   NULL,
};

const GUI_FormStru gui_from_main = 
{
	.load    = load,
	.update  = dc_update_main,
	.keys    = &gui_mainmenu_keys,
  .refresh = &gui_mainmenu_refresh_time,
};

static void load(uint8_t nowpage, uint8_t nowfocus)
{
  dc_cmd_change_screen(ssid);
//  dc_cmd_set_str(ssid, 8, "683650.123");
}

static void mute(void)
{
	
}

static void power(void)
{
}

static void keyt(void)
{
  gui_form_exec(&gui_from_sensorinfo, 0,0);
}

static void menu(void)
{
  gui_form_exec(&gui_from_state, 0, 0);
}

static void keyret(void)
{
}

static void enter(void)
{
}

static void down(void)
{
}

static void up(void)
{
}

static void left(void)
{
}

static void right(void)
{
}

static void ok(void)
{
}

static void volinc(void)
{
}

static void voldec(void)
{
}
